package cvar.model;

import java.util.ArrayList;

public class Constraint {
  
  private ArrayList<Variable> notNullVariables_;
  private ArrayList<Double> notNullValues_;

  private double b_;
  
  public Constraint() {
    notNullVariables_ = new ArrayList<Variable>();
    notNullValues_ = new ArrayList<Double>();
    b_ = 0.0;
  }
  
  public void setVariableCoefficient(Variable var, double coef) {
    if (0.0 != coef) {
      notNullVariables_.add(var);
      notNullValues_.add(coef);
    }
  }

  public void setB(double b) {
    b_ = b;
  }

  public ArrayList<Variable> getNotNullVariables() {
    return notNullVariables_;
  }

  public double getB() {
    return b_;
  }

  public ArrayList<Double> getVariableCoefficients() {
    return notNullValues_;
  }

}
